package com.dk.hotel.controller;

import com.dk.hotel.pojo.HotelDoc;
import com.dk.hotel.pojo.PageList;
import com.dk.hotel.pojo.RequestParams;
import com.dk.hotel.service.IHotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/hotel")
@CrossOrigin //跨域  or  在网关中配置
public class HotelController {

//    public static final String LIST ="/list" ;

    @Autowired
    private IHotelService hotelService;

    //index-query
    @PostMapping("/list")
    public PageList<HotelDoc> query(@RequestBody RequestParams params) {
        return hotelService.search(params);
    }


//    @PostMapping("filters")
//    public Map<String, List<String>> getFilters(@RequestBody RequestParams params){
//        return hotelService.getFilters(params);
//    }
}
